<? 
session_start();
if(isset($_SESSION['gbl_user_id']))
{
	require_once("admin/admin_functions.php");
	require_once("admin/classes/admin_users.php");		
	require_once("admin/classes/customer.php");	
	chk_session();
	$custObj=new Customer($_REQUEST['cid']);
} else {
	require_once("admin/dbconnect.php");
	require_once("admin/classes/customer.php");		
	require_once("admin/classes/check_customer_session.php");
	check_customer_session(); 
	
}
		$custObj=new Customer($_SESSION['ep_customer_id']);
	
if($_POST['submit'] != ""){
	$custObj->address=$_POST['address'];	
	$custObj->city=$_POST['city'];
	$custObj->tel=$_POST['tel'];
	$custObj->mob=$_POST['mob'];
	$custObj->country=$_POST['country'];
	$custObj->state=$_POST['state'];

	if(!$mesg){
		$mesg = $custObj->mod_customer();
		
		if(isset($_SESSION['gbl_user_id'])){
		echo "<script language=javascript>window.close();</script>";
		//header("location: admin/admin_home.php?m=1");
		exit;} 
			
	}
	
}

?>
<?php require_once('include/header.php'); ?>

      <div id="middle_container_for_innerpage">
      <div id="innerpage_top_image"><img src="images/images/innerpage_top_corner_820x5.jpg"  height="5" /></div> 
      <div id="middle_inner_container">
      <?php require_once('include/left_menu.php'); ?>
        
        <div id="inner_page_middle_data">
        	<div id="page_heading">Change Contact Details </div>
            <div id="form_alignmentor">
        	<div id="change_profile_form">	
          		<form action="change_profile.php" method="POST" name="reg" id="reg">
                	<div id="change_profile_form_fields_heading">Personal Profile</div>
        			<div id="change_profile_form_fields2">
                    	<div id="chng_pro_text">Address:</div>
                        <div id="chng_pro_field"><input type="text" name="address" value="<?=stripslashes($custObj->address)?>" style="width:250px;" /></div>
                    </div>
                    <div id="change_profile_form_fields">
                        <div id="chng_pro_text">Telephone:</div>
                        <div id="chng_pro_field"><input type="text" name="tel" value="<?=stripslashes($custObj->tel)?>" style="width:150px;" /></div>
                    </div>
                    <div id="change_profile_form_fields2">
                        <div id="chng_pro_text">Mobile:</div>
                        <div id="chng_pro_field"><input type="text" name="mob" value="<?=stripslashes($custObj->mob)?>" style="width:150px;" /></div>
                    </div>
                    <div id="change_profile_form_fields">
                    	<div id="chng_pro_text">City:</div>
                        <div id="chng_pro_field">
                        	<select name="city" id="city" style="width:162px;">
								<?
									$str="select * from nativeplace order by nativeplace_id ASC";
									$rc = mysql_query($str) or die ("Sorry! could not execute query $str ".mysql_error());
							while($row=mysql_fetch_array($rc)){

							?>			  
                <option value="<?=$row['nativeplace_id']?>" <?if($row['nativeplace_id']==$custObj->city){ echo "selected";}?>><?=$row['nativeplace']?></option>

						<? } ?>
            </select>
                        </div>
                    </div>
                    <div id="change_profile_form_fields">
                        <div id="chng_pro_text">State:</div>
                        <div id="chng_pro_field">
                        	<select name="state" id="state" style="width:162px;">
								<?
									$str="select * from state order by state_id DESC";
									$rc = mysql_query($str) or die ("Sorry! could not execute query $str ".mysql_error());
									while($row=mysql_fetch_array($rc)){
								?>			  
                				<option value="<?=$row['state_id']?>" <?if($row['state_id']==$custObj->state){ echo "selected";}?>><?=$row['state']?></option>
								<? } ?>
            				</select>
                        </div>
                    </div>
                    <div id="change_profile_form_fields2">
                        <div id="chng_pro_text">Country:</div>
                        <div id="chng_pro_field">
                        	<select name="country" id="country" style="width:200px;">
								<?
									$str="select * from country order by country_id DESC";
									$rc = mysql_query($str) or die ("Sorry! could not execute query $str ".mysql_error());
									while($row=mysql_fetch_array($rc)){
								?>			  
                				<option selected="selected" value="<?=$row['country_id']?>" <?if($row['country_id']==$custObj->country){ echo "selected";}?>><?=$row['country']?></option>
								<? } ?>
        				    </select>
                        </div>
                    </div>
                    <div id="change_profile_form_fields" style="padding-top:10px;padding-bottom:10px;">
                        <div id="button_border" ><input name="Change_contact" type="submit" class="button" id="Change_contact" value="Change Contact" /></div>
                      </div>
                    
      			</form>
        </div>
        </div>
        </div>
        

       
       
      </div> 
      <div id="corner_container_bottom_for_innerpage"><img src="images/images/innerpage_bottom_corner_820x10.jpg"  height="10" /></div>
    </div> 
      <!-- middle_container ends -->
    
    
        
    
<?php require_once('include/footer.php'); ?>
